﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Templates/DefaultMaster.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Templates_PledgeEntry_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<h1><asp:Image ID="Image2" ImageUrl="~/dbimages/h1-makeAPledge.gif" AlternateText="Make A Pledge" runat="server" /></h1>
<asp:Panel ID="pnlAlreadyEntered" Visible="false" runat="server">
<p style="color:Red">You have already entered.</p>
</asp:Panel>
<asp:Panel ID="pnlEnterDetails" DefaultButton="btnEnter" Visible="true" runat="server">
<acms:HtmlContentControlDisplay ID="htmlIntro" ControlName="Introduction" runat="server" />

    <acms:FlashControl id="flash" FlashFileUrl="~/pledgeCount.swf" WMode="Window" Width="550" Height="400" runat="server"/>
<%--<acms:HtmlContentControlDisplay    
--%>
<p>Schools – please remember to enter your pupil number into the carbon calculator so that we can calculate how many pledges have been made per pupil!</p>
<p>To make a pledge you will need to enter your name and email address. You will then be sent an automatic email to confirm your identity. Once you have verified your email address your pledge will be added to your chosen school’s total.</p>
<ul class="form">
    <li class="title">Select your pledge
    <acms:CheckedRequiredValidator ID="valpledgeChoice" ControlsToValidate="p1,p2,p3,p4,p5" Display="Dynamic" ErrorMessage="Please select a pledge" runat="server" /></li>
    <li class="formItem">
        <span class="formLabel">
           
            <asp:RadioButton id="p1" Text="I will <strong>switch off the tap when brushing my teeth</strong>, annually saving 4.64kg of CO<sub>2</sub>." GroupName="pledgeChoice" runat="server"/><br />
            <asp:RadioButton id="p2" Text="I will <strong>walk or cycle to school/work/shops instead of driving</strong>, annually saving 214.32kg of CO<sub>2</sub>." GroupName="pledgeChoice" runat="server"/><br />
            <asp:RadioButton id="p3" Text="I will <strong>turn my computer off instead of leaving it on standby</strong> annually saving 108.5kg of CO<sub>2</sub>." GroupName="pledgeChoice" runat="server"/><br />
            <asp:RadioButton id="p4" Text="I will <strong>draught proof my house</strong>, annually saving 150kg of CO<sub>2</sub>." GroupName="pledgeChoice" runat="server"/><br />
            <asp:RadioButton id="p5" Text="I will <strong>use a compost bin at home</strong>, annually saving 44.6kg of CO<sub>2</sub>." GroupName="pledgeChoice" runat="server"/><br />
        </span>
    </li>
    <li class="title">Your Details</li>
    <li class="formItem">
        <span class="formLabel">
            <asp:Label ID="Label13" Text="First Name:" AssociatedControlID="txtFirstName" runat="server" />
            <span style="color: Red">*</span>
            <asp:RequiredFieldValidator ID="valFirstName" ErrorMessage="First name must be entered." ControlToValidate="txtFirstName" Display="Dynamic" runat="server" />
        </span>
        <span class="forminput">
            <asp:TextBox ID="txtFirstName" runat="server"/>
        </span>
    </li>
    
    <li class="formItem">
        <span class="formLabel">
            <asp:Label ID="Label1" Text="Second Name:" AssociatedControlID="txtSecondName" runat="server" />
            <span style="color: Red">*</span>
        </span>
        <span class="forminput">
            <asp:TextBox ID="txtSecondName" runat="server" />
            <asp:RequiredFieldValidator ID="valSecondName" ErrorMessage="Second name must be entered." ControlToValidate="txtSecondName" Display="Dynamic" runat="server" />
        </span>
    </li>
    
    <li class="formItem">
        <span class="formLabel">
            <asp:Label ID="Label2" Text="Email Address:" AssociatedControlID="txtEmail" runat="server" />
            <span style="color: Red">*</span>
        </span>
        <span class="forminput">
            <asp:TextBox ID="txtEmail" runat="server"/>
            
            <asp:RequiredFieldValidator ID="valEmail" ErrorMessage="Email Address must be entered." ControlToValidate="txtEmail" Display="Dynamic" runat="server" />
            
            <asp:RegularExpressionValidator
                ID="RegularExpressionValidator1"
                ControlToValidate="txtEmail"
                ValidationExpression="^([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z+])*@([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.)+[a-zA-Z]{2,9})$"
                EnableClientScript="true"
                ErrorMessage="Please check your email address."
                runat="server" />
        </span>
    </li>
    <li class="formItem">
        <span class="formLabel">
            <asp:Label ID="Label3" Text="I pledge to support:" AssociatedControlID="ddlSchoolChoice" runat="server" />
            <span style="color: Red">*</span>
        </span>
        <span class="forminput">
                <asp:DropDownList runat="server" ID="ddlSchoolChoice">
                <asp:ListItem Value="-1">Select your school...</asp:ListItem>
                </asp:DropDownList>
                <asp:CompareValidator ID="valSchoolChoice" runat="server" ControlToValidate="ddlSchoolChoice" Display="Dynamic" ErrorMessage="You must select a pledge." Operator="NotEqual" ValueToCompare="-1">Please Select a school.</asp:CompareValidator>
                
        </span>
    </li>
    <li class="formItem buttons">
        <span class="forminput">
            <asp:Button ID="btnEnter" Text="Pledge!" runat="server"  />
        </span>
    </li>
    
    <li class="formItem">
        <span class="forminput">
            <asp:HyperLink ID="lnkPledgeAssumptions" Text="Pledge Assumptions" Target="_blank" runat="server" NavigateUrl="~/PledgeAssumptions.html" />
        </span>
    </li>  
</ul>

</asp:Panel>

<asp:Panel ID="pnlPledgeConfirm" Visible="false" runat="server">
<h3>Thank You!</h3>
<p>Please check your email inbox you have been sent an email, please follow its instructions to verify your email address.</p>

</asp:Panel>

</asp:Content>

